🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / data / src / commonMain / kotlin / org / meshtastic / core / data / ai / AiFunctionProvider.kt
Displaying Raw • Download
core/data/src/commonMain/kotlin/org/meshtastic/core/data/ai/AiFunctionProvider.kt 3ca87fa0323214c7204c9d37acfe9d4b6ab6ea8b (3ca87fa0) Text, 4.22 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.data.ai
T8b949e/**
* Platform-agnostic contract defining operations that AI systems can invoke.
*
* This interface abstracts the app capabilities exposed to system AI assistants. On Android, the implementation is
* wired to AppFunctions. On other platforms, equivalent mechanisms (App Intents on iOS, MCP on Desktop) can implement
* this.
*/
Tff7b72interface T56d364AiFunctionProvider Tb4b4b4{
T8b949e/**
* Send a text message over the mesh network.
*
* The destination is resolved by name using fuzzy matching — either a node name for direct messages or a channel
* name for broadcast. If both are null, the message is broadcast on the primary channel.
*
* @param text The message text to send.
* @param recipientName Optional node name for direct messages.
* @param channelName Optional channel name. Defaults to primary channel if omitted.
* @return Result indicating success or a typed failure reason.
*/
Tff7b72suspend Tff7b72fun Td2a8ffsendMessageTb4b4b4(Te6edf3textTb4b4b4: Tffa657StringTb4b4b4, Te6edf3recipientNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4, Te6edf3channelNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4)Tb4b4b4: Te6edf3SendMessageResult
T8b949e/**
* Get the current mesh network status summary.
*
* @return Current connection state, node counts, and local device info.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetMeshStatusTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3MeshStatusResult
T8b949e/**
* List all nodes currently visible on the mesh network.
*
* @return Success with list of nodes, or failure if not connected.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetNodeListTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3GetNodeListResult
T8b949e/**
* List all available mesh channels and their configurations.
*
* @return Success with list of channels, or failure if not connected.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetChannelInfoTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3GetChannelInfoResult
T8b949e/**
* Get status and metrics of the local mesh radio device.
*
* @return Success with device status, or failure if device unavailable.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetDeviceStatusTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3GetDeviceStatusResult
T8b949e/**
* Get detailed telemetry and status for a specific mesh node.
*
* @param nodeId The target node ID (in Meshtastic format: "!hex" or user ID).
* @return Success with node details, or failure if not connected or node not found.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetNodeDetailsTb4b4b4(Te6edf3nodeIdTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3GetNodeDetailsResult
T8b949e/**
* Get aggregate network metrics and statistics for the entire mesh.
*
* @return Success with mesh metrics, or failure if not connected.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetMeshMetricsTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3GetMeshMetricsResult
T8b949e/**
* Get recent messages from the mesh network.
*
* Messages are returned from the local cache — an active radio connection is not required.
*
* @param contactName Optional contact/channel name to filter by. Uses fuzzy matching.
* @param limit Maximum number of messages to return (default 20, max 50).
* @return Success with list of messages, or failure if contact not found.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetRecentMessagesTb4b4b4(
Te6edf3contactNameTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3limitTb4b4b4: Tffa657Int Tff7b72= Te6edf3DEFAULT_MESSAGE_LIMITTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3GetRecentMessagesResult
T8b949e/**
* Get a summary of unread messages grouped by contact.
*
* Returns the total unread count and a per-contact breakdown with the last message preview. Muted contacts are
* excluded.
*
* @return Unread summary with per-contact breakdown.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetUnreadSummaryTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3GetUnreadSummaryResult
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72const Tff7b72val Te6edf3DEFAULT_MESSAGE_LIMIT Tff7b72= T79c0ff2T79c0ff0
Tff7b72const Tff7b72val Te6edf3MAX_MESSAGE_LIMIT Tff7b72= T79c0ff5T79c0ff0
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s